/**
 * 百度统计
 */
var _hmt = _hmt || [];
(function () {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?16c97a057b866bf4d2c8b35276645e5b";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();


APP
  .run(['$rootScope', '$location', function ($rootScope, $location) {
    $rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) {
      //百度统计
      var targetUrl = $location.$$absUrl.substring(location.origin.length);
      _hmt.push(['_trackPageview', targetUrl]);
      _hmt.push(['_setCustomVar', 1, '#orderSuccess', fromState.name, 3]);
    });
  }])
;
